<script setup lang='ts'>
 import { ref } from 'vue';

 import { reactive } from 'vue'
  
  // do not use same name with ref
  const form = ref({
    phone: '11',
    password: '8',
 
  })
  
  const onSubmit = () => {
    console.log('submit!')
  }

</script>

<template>
   <div class="login">
    <el-form :model="form" label-width="auto" style="max-width: 600px">
      <el-form-item label="phone">
        <el-input v-model="form.phone" />
      </el-form-item>
      <el-form-item label="password">
        <el-input v-model="form.password" />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">login</el-button>
      </el-form-item>
    </el-form>
   </div>
  </template>

<style scoped>

</style>